import { RouterView } from 'vue-router'

export default [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('@/views/Home/index.vue'),
    meta: { isShow: true, title: '明细' }
  },
  {
    path: '/news',
    name: 'news',
    component: () => import('@/views/News/index.vue'),
    meta: { isShow: true, title: '新闻' }
  },
  {
    path: '/bookKeeping',
    name: 'bookKeeping',
    component: RouterView,
    children: [
      {
        path: '',
        name: 'bookKeeping',
        component: () => import('@/views/BookKeeping/index.vue'),
        meta: { title: '记账' }
      }
    ]
  },
  {
    path: '/community',
    name: 'community',
    component: RouterView,
    children: [
      {
        path: '',
        name: 'community',
        component: () => import('@/views/Community/index.vue'),
        meta: { isShow: true, title: '社区' }
      },
      {
        path: 'publish',
        name: 'publish',
        component: () => import('@/views/Publish/index.vue'),
        meta: { title: '发帖' }
      }
    ]
  },
  {
    path: '/personal',
    name: 'personal',
    component: () => import('@/views/Personal/index.vue'),
    meta: { isShow: true, title: '我的' }
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/Login/index.vue'),
    meta: { title: '登录' }
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('@/views/Register/index.vue'),
    meta: { title: '注册' }
  },
  {
    path: '/notFount',
    name: 'notFount',
    component: () => import('@/views/NotFount/index.vue'),
    meta: { title: 'NotFount-404' }
  },
  {
    path: '/:catchAll(.*)',
    redirect: '/notFount'
  }
]
